package com.vj.router.client.grpc;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class GrpcClientConfig {

    @Value("${grpc.server.host}")
    private String grpcHost;

    @Value("${grpc.server.port}")
    private int grpcPort;

    @Bean
    public GrpcDeviceGatewayClient grpcDeviceGatewayClient() {
        String grpcServerAddress = grpcHost + ":" + grpcPort;
        return new GrpcDeviceGatewayClient(grpcServerAddress);
    }
}
